<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Storage;

class CmType extends Model
{
	use HasDateTimeFormatter;
    use SoftDeletes;

    protected $table = 'cm_type';

    public function subject()
    {
        return $this->belongsTo(CmSubject::class,'s_id','id');
    }

    public function getImgUrl()
    {
        return Storage::disk('admin')->url($this->img_url);
    }

}
